<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'emp_add.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css" href="css/emp_add.css">
<link href="css/sunny/jquery-ui-1.10.2.custom.css" rel="stylesheet">
<script src="js/jquery/jquery-1.9.1.js"></script>
<script src="js/jquery/jquery-ui-i18n.js"></script>
<script src="js/jquery/jquery-ui-1.10.2.custom.js"></script>
<script language="JavaScript" type="text/javascript" src="js/emp_add.js"></script>
<script>
	$(function() {
		$("#datepicker").datepicker({
			changeYear : true,
			dateFormat : 'yy-mm-dd'
		});

	});
</script>
<script>
	function Change_Select() {//当第一个下拉框的选项发生改变时调用该函数
		$.ajax({
			url : "employeeAction!listEmployeeByDeptId.action",
			data : {
				dept_id : $("#deptid").val()
			},
			success : function(data) {
				$("#emp_name").html(data);
			}
		});
	}
</script>
</head>
<body>
	<h3>工作表现信息添加</h3>
	<div id="container">
		<form id="fm-form" method="post"
			action="performanceAction!addPerformance.action">
			<fieldset>

				<div class="fm-req">
					<label for="fm-firstname">部门</label> <select
						onChange="Change_Select()" name="job.job_dept" id="deptid">
						<sql:query var="result"
							sql="select dept_id,dept_name from t_department" />
						<!--第一个下拉菜单-->
						<option value="0">请选择</option>
						<c:forEach var="row" items="${result.rows}">
							<option value="${row.dept_id}">${row.dept_name}</option>
						</c:forEach>
					</select>
				</div>
				<div class="fm-req">
					<label for="fm-firstname">员工姓名</label> <select id="emp_name"
						name="performance.performance_emp_id"></select>
				</div>
				<div class="fm-req">
					<label for="fm-firstname">日期</label> <input type="text"
						id="datepicker" name="performance.performance_date"
						id="fm-firstname" type="text">
				</div>
				<div class="fm-req">
					<label for="fm-firstname">类型</label> <select 
						name="performance.performance_treat_type">
						<option value="奖励" >请选择</option>
						<option value="奖励" >奖励</option>
						<option value="处罚" >处罚</option>
						</select>
				</div>
				<div class="fm-req">
					<label for="fm-firstname">金额</label> <input
						name="performance.performance_treat_amount" 
						type="text">
				</div>
				<div class="fm-opt">
					<label for="fm-city">原因</label>
					<textarea name="performance.performance_reason" cols="10" rows="5"
						id="fm-comments"></textarea>
				</div>
			</fieldset>


			<div id="fm-submit" class="fm-req">
				<input name="Submit" value="&#25552; &#20132;" type="submit">
			</div>
			<br>
		</form>
	</div>
</body>
</html>
